<?php
/*
 * Copyright notice
 * 
 * (c) 2009 MH-Dev.de, Martin Hesse <info@mh-dev.de>
 * 
 * This script is part of the MH-Dev.-Board project. The MH-Dev.-Board 
 * is free software; you can redistribute it and/or modify it under the 
 * terms of the GNU General Public License as published by 
 * the Free Software Foundation; either version 3 of the License, 
 * or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful, 
 * but WITHOUT ANY WARRANTY; without even the implied warranty 
 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
 * See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU 
 * General Public License along with this program; if not, 
 * see http://www.gnu.org/licenses/.
 */


/**
 * Check notifications for posts
 * 
 * View Helper to check if a user allready being informated about new posts in a board
 * 
 * @author	Martin Hesse <info@mh-dev.de>
 * @package	MH-Dev.-Board
 */
class MHDEV_View_Helper_CheckNotify extends Zend_View_Helper_Abstract
{
	/*
	 * Check the status
	 * 
	 * @param int $thread_uid
	 * @param int $user_uid
	 * 
	 * @return boolean
	 */
	public function CheckNotify($thread_uid, $user_uid)
	{
		// db
		$notice 	= new ThreadsNotice();
		
		// query
		$getNotices	= $notice->fetchAll('thread_uid = ' . (int)$thread_uid . ' AND user_uid = ' . (int)$user_uid);
		
		// check
		if($getNotices->count() > 0)
		{
			return true;
		}
		else
		{
			return false;
		}
	}
}